Deavmi's coding shack
Commit e9414ffb52845d22961870ac1faa38738e72cc6d
Parents : aa0e99c
Author : Tristan B. Kildaire <deavmi@redxen.eu>
Date : 2021-05-31T16:24:36+02:00
Added script to generate code examples
Changes
2 files changed, 36 insertions(+), 0 deletions(-)
Diff
diff --git a/new_docs/content/documentation/examples/_index.md b/new_docs/content/documentation/examples/_index.md
new file mode 100644
index 0000000..9953744
--- /dev/null
+++ b/new_docs/content/documentation/examples/_index.md
@@ -0,0 +1,6 @@
+---
+title: Code examples
+---
+
+This page holds an assortment of code exampls that have been or are being used to test the compiler during development, it's also helpful to give you an idea as to what the syntax is since so far it hasn't been documented in a formal manner (either written out with explanations or via a grammar).
+
diff --git a/new_docs/content/documentation/examples/makeDocs.sh b/new_docs/content/documentation/examples/makeDocs.sh
new file mode 100644
index 0000000..b9d6178
--- /dev/null
+++ b/new_docs/content/documentation/examples/makeDocs.sh
@@ -0,0 +1,30 @@
+# Delete everything (except index page)
+mv _index.md bruh
+rm *.md
+mv bruh _index.md
+
+rm -rf tFiles
+
+# Fetch current testing files
+mkdir tFiles
+cd tFiles
+wget --mirror http://deavmi.assigned.network/projects/tdists/May/a1c6eb9c748fc8836140329f2bc63bd03a282d2a/src/source/tlang/testing/ -l 1 -nd
+cd ..
+
+p=0
+
+for i in $(ls tFiles)
+do
+ # Output filename
+ file="$p.md"
+ echo "---" > "$file"
+ echo "title: $i" >> "$file"
+ echo "tags: [codeExample]" >> "$file"
+ echo -e "---\n" >> "$file"
+ echo -e "# Example: \`$i\`\n" >> "$file"
+ echo -e "\`\`\`d" >> "$file"
+ cat "tFiles/$i" >> "$file"
+ echo -e "\`\`\`" >> "$file"
+
+ p=$(($p+1))
+done
Served by rngit 1.5.0 - Generated in 0.14s